<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Template</title>
</head>
<body>

	<div id="content"></div>

<script src='template.js'></script>
<script id="test" type="text/html">
<h1>{{title}}</h1>
<div>这是测试文档</div>
<ul>
    {{each list as value i}}
        <li>索引 {{i + 1}} ：{{value.a}}</li>
    {{/each}}
</ul>
</script>
<script>
	var data = {
	    title: '测试',
	    list: [{a:'文艺'}, {a:'文艺'},{a:'文艺'},{a:'文艺'},{a:'文艺'},]
	};
	var html = template('test', data);
	document.getElementById('content').innerHTML = html;
</script>
</body>
</html>